// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 注册
import register from '@/views/register';
// 首页
import index from '@/views/index';

/**
 * 基础信息
 */
//工厂定义
//import factory from "@/views/basicInfomation/factory";

//产品管理
import Production from "@/views/basicInfomation/Production";

//品牌管理
//import label from "@/views/basicInfomation/label";
//产品属性
//import production_attr from "@/views/basicInfomation/production_attr";

//客商管理
import Merchant from "@/views/basicInfomation/Merchant";
/**
 * 财务管理
 */
//发票管理
import Invoice from "@/views/finance/Invoice";
//财务统计
import Finance from "@/views/finance/Finance";
/**
 * 生产看板
 */
//图表分析
import Analysis from "@/views/board/Analysis";

//计量单位
//import unit from "@/views/basicInfomation/unit";
//数据字典
//import dictionary from "@/views/basicInfomation/dictionary";

/**
 * 生产信息
 */
// //生产班组
// import uprodautionTeamnit from "@/views/productInfomation/prodautionTeam";
// //物料档案
// import materialInventory from "@/views/productInfomation/materialInventory";
// //生产BOM
// import BOM from "@/views/productInfomation/BOM";
// //工序定义
// import process from "@/views/productInfomation/process";
// //工艺路线
// import processRoute from "@/views/productInfomation/processRoute";

//仓库定义
 import WarehouseInfo from "@/views/warehouse/WarehouseInfo";

// //缺陷定义
// import defect from "@/views/productInfomation/defect";  
// //检查项目
// import inspectionItem from "@/views/productInfomation/inspectionItem";  
// //检验标准
// import inspecetionStandrad from "@/views/productInfomation/inspecetionStandrad";  

/**
 * 生产计划
 */
//生产订单
import Order from "@/views/productPlan/Order";  
//订单详情分析
//import OrderAnalysis from "@/views/productPlan/OrderAnalysis";
/**
 * 生产仓库
 */
//成品入库
import Store from "@/views/productWarehouse/Store";  
//成品库存
import Stock from "@/views/productWarehouse/Stock";  
//成品发货
import Deliver from "@/views/productWarehouse/Deliver"; 

/**
 * 系统配置
 */
//组织管理
import Dept from "@/views/system/Dept";  
//用户管理
import User from "@/views/system/User";  
//岗位管理
import Position from "@/views/system/Position";  
//角色权限
import Role from "@/views/system/Role";
//修改密码
import Password from "@/views/system/Password"; 

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [
        {
            path: '/',
            name: '',
            component: login,
            hidden: true,
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/login',
            name: '登录',
            component: login,
            hidden: true,
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/register',
            name: '注册',
            component: register,
            hidden: true,
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/index',
            name: '首页',
            component: index,
            iconCls: 'el-icon-tickets',
            children: [
                {
                    path: '/basicInfomation/Production',
                    name: '产品管理',
                    component: Production,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/basicInfomation/Merchant',
                    name: '客商管理',
                    component: Merchant,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/productPlan/Order',
                    name: '生产订单',
                    component: Order,
                    meta: {
                        requireAuth: true
                    }
                },
               /* {
                  path: '/productPlan/OrderAnalysis',
                  name: '订单详情分析',
                  component: OrderAnalysis,
                  meta: {
                      requireAuth: true
                  }
              },*/
                {
                    path: '/productWarehouse/Store',
                    name: '成品入库',
                    component:Store,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/productWarehouse/Deliver',
                    name: '成品发货',
                    component: Deliver,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/productWarehouse/Stock',
                    name: '成品库存',
                    component: Stock,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/warehouse/WarehouseInfo',
                    name: '仓库定义',
                    component: WarehouseInfo,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/system/Dept',
                    name: '组织管理',
                    component: Dept,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/system/User',
                    name: '用户管理',
                    component: User,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/system/Position',
                    name: '岗位管理',
                    component: Position,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/system/Role',
                    name: '角色管理',
                    component: Role,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/finance/Invoice',
                    name: '发票管理',
                    component: Invoice,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/finance/Finance',
                    name: '财务统计',
                    component: Finance,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/system/password',
                    name: '修改密码',
                    component: Password,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/board/Analysis',
                    name: '图表分析',
                    component: Analysis,
                    meta: {
                        requireAuth: true
                    }
                },
            ]
        }
    ]
})